<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>操作</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" type="text/css" href="layui/css/layui.css" />
    <script src="layui/layui.js"></script>
</head>


<body class="layui-layout-body">


<div class="layui-card">

    <div class="layui-card-body">

        <button onclick="hospital()" type="button" class="layui-btn layui-btn-primary">上传机构信息</button>
        <button onclick="addAndUpdate()" type="button" class="layui-btn layui-btn-primary">科室医生增加</button>

        <br><br><br>
        排班日期
        <input type="text" style="width:120px;"  id="date1" autocomplete="off" placeholder="请选择排班信息" class="layui-input">
        <br>
        <button onclick="insertSchedule()" type="button" class="layui-btn layui-btn-primary">医生排班信息上传接口</button>
<!--        <button onclick="getStopDiagnosis()" type="button" class="layui-btn layui-btn-primary">停诊</button>-->

    </div>
</div>


<script>

    var $,element,layer,laydate;
    layui.use(['element','layer','laydate'],function() {
         element = layui.element;
         layer = layui.layer;
         $ = layui.jquery;
         laydate=layui.laydate;

        laydate.render({
            elem: '#date1'
            ,format: 'yyyyMMdd'
        });
    });


    function hospital() {
        $.post("/v1/api/hospital",{},function (res){
            alert(JSON.stringify(res));
            console.log(res)
        });
    }
    function addAndUpdate() {
        $.post("/v1/api/addAndUpdate",{},function (res){
            alert(JSON.stringify(res));
            console.log(res)
        });
    }

    function insertSchedule() {
        if($('#date1').val()==''){
            alert('请选择排班信息');return;
        }
        $.post("/v1/api/insertSchedule?date="+$('#date1').val(),{},function (res){
            alert(JSON.stringify(res));
            console.log(res)
        });
    }
    function getStopDiagnosis() {
        $.post("/v1/api/getStopDiagnosis",{},function (res){
            alert(JSON.stringify(res));
            console.log(res)
        });
    }
</script>
</body>
</html>
